/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.util.Date;

/**
 * @author Wole Adetiba
 */
public class Organisation_InformationClp extends BaseModelImpl<Organisation_Information>
	implements Organisation_Information {
	public Organisation_InformationClp() {
	}

	public String getPrimaryKey() {
		return _applicationId;
	}

	public void setPrimaryKey(String pk) {
		setApplicationId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _applicationId;
	}

	public String getApplicationId() {
		return _applicationId;
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		return _userId;
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getOrganisationName() {
		return _organisationName;
	}

	public void setOrganisationName(String organisationName) {
		_organisationName = organisationName;
	}

	public String getNatureOfBusiness() {
		return _natureOfBusiness;
	}

	public void setNatureOfBusiness(String natureOfBusiness) {
		_natureOfBusiness = natureOfBusiness;
	}

	public String getRegNo() {
		return _regNo;
	}

	public void setRegNo(String regNo) {
		_regNo = regNo;
	}

	public String getCountryOfReg() {
		return _countryOfReg;
	}

	public void setCountryOfReg(String countryOfReg) {
		_countryOfReg = countryOfReg;
	}

	public Date getDateOfRegistration() {
		return _dateOfRegistration;
	}

	public void setDateOfRegistration(Date dateOfRegistration) {
		_dateOfRegistration = dateOfRegistration;
	}

	public Organisation_Information toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (Organisation_Information)Proxy.newProxyInstance(Organisation_Information.class.getClassLoader(),
				new Class[] { Organisation_Information.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Organisation_InformationClp clone = new Organisation_InformationClp();

		clone.setApplicationId(getApplicationId());
		clone.setUserId(getUserId());
		clone.setOrganisationName(getOrganisationName());
		clone.setNatureOfBusiness(getNatureOfBusiness());
		clone.setRegNo(getRegNo());
		clone.setCountryOfReg(getCountryOfReg());
		clone.setDateOfRegistration(getDateOfRegistration());

		return clone;
	}

	public int compareTo(Organisation_Information organisation_Information) {
		int value = 0;

		value = getApplicationId()
					.compareTo(organisation_Information.getApplicationId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Organisation_InformationClp organisation_Information = null;

		try {
			organisation_Information = (Organisation_InformationClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = organisation_Information.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(15);

		sb.append("{applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", organisationName=");
		sb.append(getOrganisationName());
		sb.append(", natureOfBusiness=");
		sb.append(getNatureOfBusiness());
		sb.append(", regNo=");
		sb.append(getRegNo());
		sb.append(", countryOfReg=");
		sb.append(getCountryOfReg());
		sb.append(", dateOfRegistration=");
		sb.append(getDateOfRegistration());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(25);

		sb.append("<model><model-name>");
		sb.append(
			"com.crossriver.crgis.database.model.Organisation_Information");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>organisationName</column-name><column-value><![CDATA[");
		sb.append(getOrganisationName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>natureOfBusiness</column-name><column-value><![CDATA[");
		sb.append(getNatureOfBusiness());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>regNo</column-name><column-value><![CDATA[");
		sb.append(getRegNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>countryOfReg</column-name><column-value><![CDATA[");
		sb.append(getCountryOfReg());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>dateOfRegistration</column-name><column-value><![CDATA[");
		sb.append(getDateOfRegistration());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _applicationId;
	private String _userId;
	private String _organisationName;
	private String _natureOfBusiness;
	private String _regNo;
	private String _countryOfReg;
	private Date _dateOfRegistration;
}